import request from '../../utils/request'

// 获取学科列表
export const getSubjectList = (level:any) => request.get('/subjectList',{params:level})

// 查询学科列表
export const findSubjectList = (name: any) => request.get('/subjectList', {params: name})

export interface ISubject {
    "id"?: number,
    "name"?: string,
    "level"?: number,
    "levelName"?: string,
    "deleted"?: boolean
}
// 增加学科列表
export const addSubjectList = (data: ISubject) => request.post('/subjectList', data)

// 删除学科列表
export const delSubjectList = (id: number) => request.delete(`/subjectList/${id}`)

// 编辑学科列表
export const editSubjectList = (id: number, data: ISubject) => request.put(`/subjectList/${id}`, data)

// 获取学生列表
export const getStudentList = () => request.get('/studentList')

export interface IStudent {
  "id"?: number,
  "userName"?: string,
  "age"?: number,
  "role"?: number,
  "sex"?: string,
  "birthDay"?: string,
  "phone"?: string,
  "lastActiveTime"?: string,
  "status"?: boolean,
  "userLevel"?: number
}
// 增加学生列表
export const addStudentList = (data: IStudent) => request.post('/studentList', data)

// 修改学生列表
export const editStudentList = (id: number, data: IStudent) => request.put(`/studentList/${id}`, data)

// 删除学生列表
export const delStudentList = (id: number) => request.delete(`/studentList/${id}`)

// 查询学生
export const findStudentList = (userName: any) => request.get("/studentList", {params: userName})

// 获取年级
export const getGradeList = () => request.get('/gradeList')

//  用户活跃度
export const mothDayDoExamQuestionValue = () => request.get('/mothDayDoExamQuestionValue')

// 试卷数
export const homeList = () => request.get('/homeList')

// 获取试卷列表
export const getPaperList = () => request.get('/paperList')

// // 获取批改列表
// export const answer = () => request.get('/answer')

// // 编辑批改列表
// export interface IAnswer {
//    doRight?: boolean,
//    content?: string,
//    itemOrder?: number,
//    contentArray?: any,
//    score?: number,
//    questionScore?: number
  
//   }
//   export const editAnswer = (id: number, data:IAnswer) => request.put(`/video/${id}`,data)

